﻿using System;
using System.Collections.Generic;
using Volo.Abp.MultiTenancy;
using EasyAbp.Abp.Trees;
using Joy.Erp.BasicArchives.Core;
using Joy.Erp.BasicArchives.Core.EntityAttributes;

namespace Joy.Erp.BasicArchives.ItemMasters
{
    /// <summary>
    /// 料品类型
    /// </summary>
    public class ItemCategory : ArchiveAggregateRoot, IMultiTenant, ITree<ItemCategory>
    {
        /// <summary>
        /// 所属租户
        /// </summary>
        public Guid? TenantId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 父级编号
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 父分类
        /// </summary>
        public ItemCategory Parent { get; set; }

        /// <summary>
        /// 子分类
        /// </summary>
        public ICollection<ItemCategory> Children { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Unique]
        public string DisplayName { get; set; }
    }
}
